package com.hopu.v1.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hopu.v1.pojo.common.Update;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;

/**
 * @Author: YwaiX
 * @Version: 1.0
 * @Date: Created in 2024-10-16 19:24:25
 * @Description: 学生信息vo
 */

@Data
public class EmploymentInfoVo {
	/**
	 * id
	 */
	private Integer id;
	
	/**
	 * 年龄
	 */
	@NotNull(message = "年龄不能为空", groups = Update.class)
	private Integer age;
	
	/**
	 * 学号
	 */
	@Length(message = "学号应为9位", min = 9, max = 9, groups = Update.class)
	@Pattern(regexp = "^[A-Z]{2}[0-9]{7}$", message = "学号格式不正确，需为前两位大写字母后七位数字", groups = Update.class)
	@NotNull(message = "学号不能为空", groups = Update.class)
	private String studentId;
	
	/**
	 * 姓名
	 */
	@Length(message = "姓名不低于2位", min = 2, groups = Update.class)
	@Pattern(regexp = "^[\\u4e00-\\u9fa5]+$", message = "姓名格式不正确，不得低于2位中文", groups = Update.class)
	@NotBlank(message = "姓名不能为空", groups = Update.class)
	private String name;
	
	/**
	 * 昵称
	 */
	private String nickname;
	
	/**
	 * 性别
	 */
	@NotBlank(message = "性别不能为空", groups = Update.class)
	private String gender;
	
	/**
	 * 电话
	 */
	@Pattern(regexp = "^1\\d{10}$", message = "手机号码格式不正确", groups = Update.class)
	@NotBlank(message = "手机号码不能为空", groups = Update.class)
	private String telephone;
	
	/**
	 * 启用状态
	 */
	private Integer status;
	
	/**
	 * 毕业状态
	 */
	private Integer statusGraduation;
	
	/**
	 * 毕业时间
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd")
	private LocalDate statusGraduationTime;
	
	/**
	 * 头像
	 */
	private String avatar;
	
	/**
	 * 班级id
	 */
	@NotNull(message = "班级Id不能为空", groups = Update.class)
	private String classId;
	
	/**
	 * 学历
	 */
	private String education;
	
	/**
	 * 身份证号
	 */
	@NotBlank(message = "身份证号不能为空", groups = Update.class)
	@Pattern(regexp = "(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)", message = "格式不正确", groups = Update.class)
	private String idCard;
	
	/**
	 * 出生日期
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd")
	private LocalDate birthday;
	
	/**
	 * 籍贯
	 */
	private String nativePlace;
	
	/**
	 * 政治面貌
	 */
	private String politicalOutlook;
	
	/**
	 * 家庭住址
	 */
	private String address;
	
	private String password;
}
